package com.example.module_motocircle.ui.search

import com.example.module_motocircle.http.MotorCircleApi
import com.example.module_motocircle.http.MotorCircleNetModule
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

class SearchRepository @Inject constructor(){
    @Inject
    @MotorCircleNetModule.CommonMainApi
    lateinit var motorCircleApi: MotorCircleApi

//    fun getSearchHotData() = flow {
//        emit(motorCircleApi.getSearchHotData())
//    }
////getSearchSuggestion
//    fun searchKeyWordList(keyWord:  String) = flow {
//        emit(motorCircleApi.searchKeyword(keyWord))
//    }.flowOn(Dispatchers.IO)




    fun getSearchHotData() = flow {
        emit(motorCircleApi.getSearchHotData())
    }

    fun getSearchSuggestion(keyWord: String) = flow {
        emit(motorCircleApi.searchKeyword(keyWord))
    }



}